home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-02 | 3.4 KB | 123 lines | [TEXT/MPS ] |
- #
- # File: Install, MPW Shell script
- # by Kerry Laidlaw
- # 2/19/93
- # Apple Computer, Inc.
- #
- # Function:
- # Install or uninstall the Localization Verifier into a user's system.
- #
- # In-Outputs:
- # None.
- #
- #
-
- # Save some initial shell variable values, and set them for our own use
-
- set saveExit {exit}
- set exit 0 # Set exit 0 so we won't abort if status variable is non-zero
- set saveEcho {echo} # echo=1 for echoing each command before execution
- set echo 0
- set saveDir `directory`
-
- # Make sure we have access to the names of the Verifier files.
- # The v.setFilenameVars script will define the following variables:
- # masterFiles = all the files that consistute the Verifier
- # toolFiles = all MPW tools used by the Verifier
- # scriptFiles = all MPW scripts used by the Verifier
-
- execute v.setFilenameVars
-
- # Make sure all the files are there to install from!
-
- for vFile in {masterFiles}
- if !"`exists -f "{vFile}"`"
- alert "The Verifier Installation failed: ∂
- ∂nThe file ∂""{vFile}"∂" could not be found. ∂
- ∂n∂nPlease set the directory to the Verifier∂'s install folder."
- set echo {saveEcho} # restore echo
- set exit "{saveExit}"
- exit 2
- end
- end
-
- # Find out if we're installing or removing.
-
- if ("`exists -f "{MPW}"Scripts:v.menu`") || ("`exists -f "{MPW}"Scripts:verify-menu`")
- # We should be removing. Make sure they want to remove the Verifier.
- Confirm "Do you want to install over the current Localization Verifier?"
- if {status} != 0 # The cancel button
- set echo {saveEcho} # restore echo
- set exit "{saveExit}"
- exit 2
- end
-
- # Destroy old files from previous versions of the Verifier
-
- delete -i -p "{MPW}"Scripts:verify-menu
- delete -i -p "{MPW}"Scripts:check-disk
- delete -i -p "{MPW}"Scripts:compare-disks
- delete -i -p "{MPW}"Scripts:makelist
- delete -i -p "{MPW}"Scripts:make.rnames
-
- # Delete the current files in both the Scripts and Tools folders.
-
- for vFile in {toolFiles}
- delete -i -p "{MPW}"Tools:"{vFile}"
- end
-
- for vFile in {scriptFiles}
- delete -i -p "{MPW}"Scripts:"{vFile}"
- end
-
- # Remove the menu.
- deletemenu "Verify" > dev:null ≥ dev:null
- open "{ShellDirectory}"UserStartup
- find • "{ShellDirectory}"UserStartup
- loop
- clear "/#∂tMake the menu for the Localization Verifier.∂n/" "{ShellDirectory}"UserStartup
- if {status} != 0
- break
- end
-
- clear "/verify-menu∂n/" "{ShellDirectory}"UserStartup
-
- clear "/v.menu∂n/" "{ShellDirectory}"UserStartup
-
- end
-
- close -y "{ShellDirectory}"UserStartup
-
- end # if installing over old verifier
-
-
- # Copy over the files to the Scripts/Tools folders as appropriate.
-
- for vFile in {toolFiles}
- duplicate -c -p "{vFile}" "{MPW}"Tools:
- end
-
- for vFile in {scriptFiles}
- duplicate -c -p "{vFile}" "{MPW}"Scripts:
- end
-
- # If the user didn't supply the "ISS" parameter then remove the rNames creation functionality
-
- if `evaluate "{1}" !~ /[iI][sS][[sS]/`
- delete -i -p "{MPW}"Scripts:v.rnames
- end
-
- # Add the new menu.
- #echo "Adding the menu command to your UserStartup file..."
-
- echo "#∂tMake the menu for the Localization Verifier." >> "{ShellDirectory}"UserStartup
- echo "v.menu" >> "{ShellDirectory}"UserStartup
- v.menu # Make the menu right now too.
-
- Alert "The SCM Verifier has been installed into your MPW system."
-
- # Restore shell variables and exit
-
- directory "{saveDir}" # Leave the directory setting unchanged
- set echo {saveEcho} # restore echo
- set exit "{saveExit}"